package com.cykj.pos.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cykj.pos.domain.AizDeductionWallet;
import com.cykj.pos.domain.BizJlMerchantInfoMemberVip;
import com.cykj.pos.domain.BizMerchantFeeName;
import com.cykj.pos.domain.SynchronizationDataDTO;
import com.cykj.pos.domain.dto.HomePageDTO;
import com.cykj.pos.domain.dto.TradingRankingDTO;
import com.cykj.pos.domain.dto.TransactionDetailsDTO;
import com.cykj.pos.domain.dto.TranscationListDTO;
import com.cykj.pos.profit.dto.HomePageDataDTO;
import com.cykj.pos.profit.dto.MerchantDTO;
import com.cykj.pos.profit.dto.PartnerDetailDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 许晓龙
 * @date 2025/1/21 15:47
 */
public interface PosTransactionNoticeMapper extends BaseMapper<SynchronizationDataDTO> {

    /**
     * 查询交易明细
     * @param transactionDetailsDTO
     * @returnpageSize
     */
    List<TranscationListDTO> selectTransactionDetails(TransactionDetailsDTO transactionDetailsDTO);

    /**
     * 查询代理一支
     * @param detailsDTO
     * @return
     */
    List<Long> selectBizMerchParentRelated(TransactionDetailsDTO detailsDTO);

    HomePageDataDTO selectHomeData(HomePageDTO homePageDTO);

    HomePageDataDTO selectHomeDataToday(HomePageDTO homePageDTO);

    /**
     * 查询今日交易额
     * @param detailsDTO
     * @return
     */
    Double todayStatistics(TransactionDetailsDTO detailsDTO);

    /**
     * 查询日激活数团队
     * @param merchantDTO
     * @return
     */
    PartnerDetailDTO selectActiveSeven(MerchantDTO merchantDTO);

    /**
     * 查询交易额
     * @param merchantDTO
     * @return
     */
    PartnerDetailDTO getPartnerAmountStatistical(MerchantDTO merchantDTO);

    /**
     * 查询交易
     * @param homePageDTO
     * @return
     */
    HomePageDataDTO selectHomeDataTranscation(HomePageDTO homePageDTO);

    /**
     * 查询收益
     * @param homePageDTO
     * @return
     */
    HomePageDataDTO selectHomeDataProfit(HomePageDTO homePageDTO);

    /**
     * 查询激活数
     * @param homePageDTO
     * @return
     */
    HomePageDataDTO selectHomeDataActive(HomePageDTO homePageDTO);

    /**
     * 查询扣款钱包
     * @param userId
     * @return
     */
    AizDeductionWallet selectDeductionWallet(Long userId);

    /**
     * 更新扣款钱包
     * @param aizDeductionWallet
     * @return
     */
    int updateDeductionWallet(AizDeductionWallet aizDeductionWallet);

    /**
     * 查询交易笔数
     * @param merchId
     * @param channel
     * @return
     */
    int selectTransCount(@Param("merchId") Long merchId,@Param("channel") String channel,@Param("monthType") String monthType);

    /**
     *
     * @param merchId
     * @param channel
     * @param format
     * @return
     */
    int selectPosTrans(@Param("merchId") Long merchId,@Param("channel") String channel, @Param("monthType")String monthType);

    /**
     * 查询分润笔数
     * @param merchId
     * @param channel
     * @param format
     * @return
     */
    int selectProfitCount(@Param("merchId") Long merchId,@Param("channel") String channel, @Param("monthType")String monthType);

    int selectPosProfit(@Param("merchId") Long merchId,@Param("channel") String channel, @Param("monthType")String monthType);

    /**
     * 收益柱状图
     * @param merchantDTO
     * @return
     */
    PartnerDetailDTO selectIncome(MerchantDTO merchantDTO);

    /**
     * 排行榜
     * @param merchId
     * @param channel
     * @param format
     * @return
     */
    List<TradingRankingDTO> selectTradingRanking(@Param("merchId") Long merchId,@Param("channel") String channel,@Param("format") String format);

    /**
     * 排行榜收益
     * @param merchId
     * @param channel
     * @param format
     * @return
     */
    List<TradingRankingDTO> selectTradingRankingIncome(@Param("merchId") Long merchId,@Param("channel") String channel,@Param("format") String format);

    /**
     * 排行榜收益全渠道
     * @param merchId
     * @param channel
     * @param format
     * @return
     */
    List<TradingRankingDTO> selectTradingRankingIncomeAllChannel(@Param("merchId") Long merchId,@Param("channel") String channel,@Param("format") String format);

    /**
     * 查询激活排行榜
     * @param merchId
     * @param channel
     * @param format
     * @return
     */
    List<TradingRankingDTO> selectActiveRanking(@Param("merchId") Long merchId,@Param("channel") String channel,@Param("format") String format);

    /**
     * 查询嘉联VIP
     * @param bizJlMerchantInfoMemberVip
     * @return
     */
    BizJlMerchantInfoMemberVip getJlVip(BizJlMerchantInfoMemberVip bizJlMerchantInfoMemberVip);

    /**
     * 添加嘉联vip
     * @param bizJlMerchantInfoMemberVip
     */
    void save(BizJlMerchantInfoMemberVip bizJlMerchantInfoMemberVip);

    BizMerchantFeeName selectFeeName(String fee);

    List<TradingRankingDTO> selectTradingRankingIncomeDangYue(@Param("merchId") Long merchId,@Param("channel") String channel,@Param("format") String format);

    List<TradingRankingDTO> selectTradingRankingIncomeAllChannelDangYue(Long merchId, String channel, String format);

    List<TranscationListDTO> selectTransactionDetailsUp(TransactionDetailsDTO detailsDTO);
}
